1. Field of the Invention
The present invention relates to a motor control device, an image forming apparatus, and a motor control method.
2. Description of the Related Art
A motor control device which performs drive control of a DC motor is known. For example, the motor control device detects a rotational speed of a DC motor and carries out feedback control of the DC motor based on a difference between the detected rotational speed and a target rotational speed. For example, a rotary encoder may be used to detect a rotational speed of a DC motor.
For example, using a rotary encoder which outputs two-phase pulses with different phase angles in accordance with rotation of a DC motor, the motor control device may determine a movement distance of an object driven by the DC motor by computation of the movement distance through summation or subtraction of a pulse count based on the number of pulses according to the rotational direction of the DC motor.
In this motor control device, if pulses are not normally output from the rotary encoder, a rotational speed of the DC motor cannot be detected correctly. In such a case, the motor control becomes instable or inaccurate. To eliminate the problem, an encoder error detection method as disclosed in Japanese Laid-Open Patent Publication No. 2004-234039 has been proposed. In this method, if a pulse count based on pulses output by a rotary encoder when an actuator is being driven remains unchanged over a given period of time, it is detected that an error in the encoder arises, thereby disabling operation of the actuator.
In this connection, an example of computation of a cumulative movement distance of an object driven by the DC motor based on the pulses output from the encoder is considered. During reverse rotation of the DC motor, a pulse count based on the pulses output from the encoder is subtracted from the cumulative movement distance. During normal rotation of the DC motor, the pulse count based on the pulses output from the encoder is added to the cumulative movement distance.
It is assumed that, in this example, the DC motor is controlled to change the rotation of the DC motor from reverse rotation to normal rotation at a first instant. A target movement distance of the object driven by the DC motor is changed at the first instant. However, in actual operation, the timing that the rotation of the DC motor is changed from reverse rotation to normal rotation is delayed from the first instant. The cumulative movement distance of the object is changed at a second instant following the first instant.
In this example, the cumulative movement distance is decreased by subtraction of the pulse count during the reverse rotation of the motor, while the cumulative movement distance is increased by summation of the pulse count during the normal rotation of the motor. The cumulative movement distance is the basis for detecting whether an encoder error arises.
However, there may be a case where the motor control device receives the cumulative movement distances at the first instant before the second instant (when the rotation of the DC motor is actually changed) and a third instant after the second instant. In such a case, the motor control device determines that the cumulative movement distance received at the third instant remains unchanged from the cumulative movement distance received at the first instant. Hence, in this case, the motor control device may not detect any change of the received cumulative movement distance even when the pulses are normally output from the encoder.
Therefore, in such a case, the encoder error detection method disclosed in Japanese Laid-Open Patent Publication No. 2004-234039 may erroneously determine that the cumulative movement distance remains unchanged over the given period of time, thereby erroneously detecting an encoder error, even though the encoder operates normally.